package com.ciaj.boot.filter;

import lombok.extern.log4j.Log4j2;
import org.apache.shiro.web.servlet.AdviceFilter;

import javax.servlet.FilterChain;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;

/**
 * @Author: ciaj.
 * @Date: 2020/8/17 18:39
 * @Description:
 * @version: 1.0
 */
@Log4j2
public class ShiroFilter extends AdviceFilter {
    @Override
    protected boolean preHandle(ServletRequest request, ServletResponse response) throws Exception {
        log.info("=====>ShiroFilter.preHandle");

        return super.preHandle(request, response);
    }

    @Override
    protected void postHandle(ServletRequest request, ServletResponse response) throws Exception {
        log.info("=====>ShiroFilter.postHandle");
        super.postHandle(request, response);
    }

    @Override
    public void afterCompletion(ServletRequest request, ServletResponse response, Exception exception) throws Exception {
        log.info("=====>ShiroFilter.afterCompletion");

        super.afterCompletion(request, response, exception);
    }
}
